<div data-role=page id=home style="background-color: #f0eff6">
	<div data-role=header data-theme=b>
		<h1>Mistake Chasing Game</h1>
	</div>
	<div data-role=content>
		<p class="text">YOUR RESULT:</p>
		<p class="text"> TOTAL OF QUESTIONS IN THIS TEST: 10 </p>
		<p class="text" id="total"> TOTAL OF QUESTIONS THAT YOU ANSWERED: </p>
		<p class="text" id="correct"> TOTAL OF CORRECT QUESTIONS: </p>

		<p>
			<a href=home.html data-role=button data-icon=back id="back_to_home"> BACK TO HOME </a>
		</p>
	</div>
	<div data-role=footer data-theme=b data-position="fixed" >
		<h1>Mistake Chasing Game (c) 2013</h1>
	</div>
	<script>
		var user_info = {
			email: sessionStorage.getItem("email"),
			total: sessionStorage.getItem("total")
		};
		$.ajax({
			 url:"http://127.0.0.1:81/Game/result.php",
			 dataType: 'jsonp',
			 data: user_info,
			 success: function(json){
				 if (json.success == 4) {
					$("#total").text($("#total").text() + sessionStorage.getItem("total"));
					$("#correct").text($("#correct").text() + json.score);
				 } else {
					 alert("ERROR");
				 }
			 },
			 error:function(){
				 alert("Error");
			 }      
		});
	</script>
</div>


